<script>on mouseupglobal theFontput me into theFontdo getFontput theFont into meend mouseup</script>
</part>
<part>
<id>3</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>98</left>
<top>63</top>
<right>270</right>
<bottom>83</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Helvetica</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>FontTS2</name>
<script>on mouseupglobal theFontput me into theFontdo getFontput theFont into meend mouseup</script>
</part>
<part>
<id>4</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>98</left>
<top>82</top>
<right>270</right>
<bottom>102</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Helvetica</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>FontTS3</name>
<script>on mouseupglobal theFontput me into theFontdo getFontput theFont into meend mouseup</script>
</part>
<part>
<id>5</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>98</left>
<top>101</top>
<right>270</right>
<bottom>121</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Helvetica</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>FontTS4</name>
<script>on mouseupglobal theFontput me into theFontdo getFontput theFont into meend mouseup</script>
</part>
<part>
<id>6</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>98</left>
<top>120</top>
<right>270</right>
<bottom>140</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Helvetica</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>FontTS5</name>
<script>on mouseupglobal theFontput me into theFontdo getFontput theFont into meend mouseup</script>
</part>
<part>
<id>7</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>98</left>
<top>139</top>
<right>270</right>
<bottom>159</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Helvetica</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>FontTS6</name>
<script>on mouseupglobal theFontput me into theFontdo getFontput theFont into meend mouseup</script>
</part>
<part>
<id>8</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>287</left>
<top>44</top>
<right>459</right>
<bottom>64</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Times</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>FontTR1</name>
<script>on mouseupglobal theFontput me into theFontdo getFontput theFont into meend mouseup</script>
</part>
<part>
<id>9</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>287</left>
<top>63</top>
<right>459</right>
<bottom>83</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Times</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>FontTR2</name>
<script>on mouseupglobal theFontput me into theFontdo getFontput theFont into meend mouseup</script>
</part>
<part>
<id>10</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>287</left>
<top>82</top>
<right>459</right>
<bottom>102</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Times</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>FontTR3</name>
<script>on mouseupglobal theFontput me into theFontdo getFontput theFont into meend mouseup</script>
</part>
<part>
<id>11</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>287</left>
<top>101</top>
<right>459</right>
<bottom>121</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Times</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>FontTR4</name>
<script>on mouseupglobal theFontput me into theFontdo getFontput theFont into meend mouseup</script>
</part>
<part>
<id>12</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>287</left>
<top>120</top>
<right>459</right>
<bottom>140</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Times</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>FontTR5</name>
<script>on mouseupglobal theFontput me into theFontdo getFontput theFont into meend mouseup</script>
</part>
<part>
<id>13</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>287</left>
<top>139</top>
<right>459</right>
<bottom>159</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Times</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>FontTR6</name>
<script>on mouseupglobal theFontput me into theFontdo getFontput theFont into meend mouseup</script>
</part>
<part>
<id>14</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>12</left>
<top>206</top>
<right>83</right>
<bottom>263</bottom>
</rect>
<style>shadow</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>15968</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Change Fonts</name>
<script>-- OKAY, OKAY, YOU CAN LAFF AT MY SCRIPTING BUT IT RUNS PRETTY FAST-- BECAUSE SOME OF THE TRICKY PART IS INLINE. THIS STACK TOOK 2 DAYS TOTALon shout -- ALERT FOR FONT FIELD IMBALANCEput "MISSING A FONT IN A SEARCH OR REPLACE FIELD!"beepwait 90put "SEARCH & REPLACE FIELDS MUST BE BALANCED"wait 90hide msgend shouton abruptExitclose file "SwissFontScratchFile"put "OPERATION CANCELLED BY USER"wait 2 secondsdo cleanupdo flushScratchhide msgexit to hyperCardend abruptExiton flushScratchopen file "SwissFontScratchFile"write empty to file "SwissFontScratchFile"close file "SwissFontScratchFile"end flushScratchon doVariations -- THIS IS THE NEAT PART-- YOU COULD MAKE THIS A GENERALIZED TEXT S/R STACK-- BY MODIFYING OR EVEN ELIMINATING THIS SECTION-- ALL IT DOES IS CARRY THE SEARCH/REPLACE FONT REQUEST FROM A CARD-- FIELD, SURRONDS IT WITH CONTEXT AND PLACES IT INTO THE OLD/NEWTEXT-- GLOBALS, TO BE USED IN THE SLICK DOTEXTCHANGE ROUTINE WHICH FOLLOWS-- ONE COULD ALSO ADD MORE CONTEXTS OR MAKE THE CONTEXTS USERSELECTABLE-- TO ENRICH THIS UTILITY. IF YOU ARE READING THIS, YOU MIGHT HAVE-- SOME GREAT IDEAS ON WHAT TO DO WITH IT. LET ME KNOW IF I CAN HELP.global searchFont,replaceFont,oldText,newText,holdNumberChanges,numberChanges,fontInTextfind string searchFont in cd fld "context" --IF NO PRINTER FONTNAME AT ALL IN FIELD, NEXTif the result contains "Not found" then exit doVariations-- %%DocumentFonts: AGaramond-Italic-- THIS IS IN "%%DocumentFonts:" PROLOGUEput "%%DocumentFonts: " & searchFont & return into oldTextput "%%DocumentFonts: " & replaceFont & return into newTextdoTextChange-- %%+ AGaramond-Italic-- THIS IS IN also in "%%DocumentFonts:" PROLOGUEput "%%+ " & searchFont & return into oldTextput "%%+ " & replaceFont & return into newTextdoTextChange-- %%IncludeFont: AGaramond-Italic-- THIS IS IN "%%BeginSetup"put "%%IncludeFont: " & searchFont & return into oldTextput "%%IncludeFont: " & replaceFont & return into newTextdoTextChange-- %AI3_BeginEncoding: _AGaramond-Italic AGaramond-Italic-- THIS IS IN "%AI3_BeginEncoding:"put "%AI3_BeginEncoding: _" & searchFont & " " & searchFont & return into oldTextput "%AI3_BeginEncoding: _" & replaceFont & " " & replaceFont & return into newTextdoTextChange-- /_AGaramond-Italic/AGaramond-Italic-- THIS TOOput "/_" & searchFont & "/" & searchFont into oldTextput "/_" & replaceFont & "/" & replaceFont into newTextdoTextChange--/_AGaramond-Italic-- FINALLY, THIS IS IN THE ACTUAL ARTWORK OR SCRIPTput numberChanges into holdNumberChangesput true into fontInTextput "/_" & searchFont & space into oldTextput "/_" & replaceFont & space into newTextdoTextChangeput false into fontInTextput (numberChanges + holdNumberChanges) into numberChangesend doVariationson doTextChange -- PRETTY CLEVER S/R FROM READYMADE FIELDS STACK-- THAT SHIPPED WITH HYPERCARD, HERE MODIFIEDglobal oldText, newText,numberChanges,fontInTextput empty into theListfind string oldText in cd fld "context"put the foundChunk into startChunk -- don't want to find forever,used to avoid recursive findsrepeatif the mouseClick then do abruptExitset cursor to busyfind string oldText in cd fld "context"if the result ≠ empty then exit repeatif the foundChunk = startChunk thenput startChunk & return before theListexit repeatend ifput the foundChunk & return after theListend repeat-- find from BOTTOM of list since replace changes the text HENCE THE CHUNKPOSITION: CUTE!if fontInText contains true then put (number of lines in theList) into numberChangesrepeat with count = number of lines in theList down to 1if the mouseClick then do abruptExitget line count of theListdo "put char 1 to" && number of chars in newText && "of newText into" && itend repeatend doTextChangeon mouseUpglobal searchFont, replaceFont,holdNumberChanges,numberChangesif the optionkey is not down then put true into rapidMode-- FIRST VERIFY FONT FIELD BALANCE, THE LAZY WAYif cd fld FontTS1 is empty and cd fld FontTR1 is not empty then shoutif cd fld FontTS2 is empty and cd fld FontTR2 is not empty then shoutif cd fld FontTS3 is empty and cd fld FontTR3 is not empty then shoutif cd fld FontTS4 is empty and cd fld FontTR4 is not empty then shoutif cd fld FontTS5 is empty and cd fld FontTR5 is not empty then shoutif cd fld FontTS6 is empty and cd fld FontTR6 is not empty then shoutif cd fld FontTS1 is not empty and cd fld FontTR1 is empty then shoutif cd fld FontTS2 is not empty and cd fld FontTR2 is empty then shoutif cd fld FontTS3 is not empty and cd fld FontTR3 is empty then shoutif cd fld FontTS4 is not empty and cd fld FontTR4 is empty then shoutif cd fld FontTS5 is not empty and cd fld FontTR5 is empty then shoutif cd fld FontTS6 is not empty and cd fld FontTR6 is empty then shoutset the hilite of me to trueput empty into cd fld "context"answer file "Pick a file whose fonts you want to change. Use a copy because this file will be overwritten:" of type "TEXT"if the result contains "Cancel" thendo cleanUpexit mouseUpend ifput it into theFile --GET FILE PATH TO PROCESS; LOAD NAME INTO THEFILEput theFile into cd fld "currentfile"set the style of cd fld "currentfile" to opaqueif rapidMode contains true then set lockscreen to true -- FOR SPEEDif it is not empty thenput the ticks into startTimeInopen file theFileopen file "SwissFontScratchFile"write empty to file "SwissFontScratchFile"put 0 into startput 0 into holdNumberChangesput 0 into numberChangesrepeatread from file theFile at start for 16000 --READ FROM POINTER TO 16000put it into memBankread from file theFile until returnput it after memBankadd the length of memBank to start -- SET BYTE POINTER FOR NEXT READ OPERATIONput "Bytes read:" && start into msgset the scroll of cd fld "context" to 0put memBank into cd fld "context"-- MAIN PROCESSING LOOP STARTS HERE, ONCE FOR EACH S/R FONT COUPLEif cd fld FontTS1 is not empty thenput cd fld FontTS1 into searchFontput cd fld FontTR1 into replaceFontdo doVariations --SUBROUTINE S/R FOR EACH OF 6 CONTEXTS FONTNAME COULD APPEAR INend ifif cd fld FontTS2 is not empty thenput cd fld FontTS2 into searchFontput cd fld FontTR2 into replaceFontdo doVariationsend ifif cd fld FontTS3 is not empty thenput cd fld FontTS3 into searchFontput cd fld FontTR3 into replaceFontdo doVariationsend ifif cd fld FontTS4 is not empty thenput cd fld FontTS4 into searchFontput cd fld FontTR4 into replaceFontdo doVariationsend ifif cd fld FontTS5 is not empty thenput cd fld FontTS5 into searchFontput cd fld FontTR5 into replaceFontdo doVariationsend ifif cd fld FontTS6 is not empty thenput cd fld FontTS6 into searchFontput cd fld FontTR6 into replaceFontdo doVariationsend ifwrite cd fld "context" to file "SwissFontScratchFile"if the length of memBank < 16000 then exit repeat --EXIT IF LAST READ WAS LESS THAN FULLend repeatclose file theFileclose file "SwissFontScratchFile"end ifdo cleanUp-- SAD EXCUSE FOR USER FRIENDLINESS! BUT PRESERVES RESOURCE FORK STUFFput (((the ticks) - startTimeIn)/60) into endTimeInanswer "Save changes?" with "No" or "Yes"if it contains "Yes" thenput the ticks into startTimeOutopen file "SwissFontScratchFile"open file theFilewrite empty to file theFileput 0 into startrepeatread from file "SwissFontScratchFile" at start for 16000 --READ&WRITE 16K BLOCKSwrite it to file theFileput "Bytes written:" && start into msgif the length of it < 16000 then exit repeatadd 16000 to startend repeatclose file theFileclose file "SwissFontScratchFile"put (((the ticks) - startTimeOut)/60) into endTimeOutset numberFormat to "0"play harpsichord dput "DONE! Elapsed time:" && (endTimeIn + endTimeOut) && "seconds. Number of changes:" && numberChanges into msgwait 3 secondsend ifselect char 0 of cd fld "context"do flushScratchhide msgend mouseUp</script>
</part>
<part>
<id>15</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <false /> </lockText>
<rect>
<left>98</left>
<top>206</top>
<right>458</right>
<bottom>358</bottom>
</rect>
<style>scrolling</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>Context</name>
<script></script>
</part>
<part>
<id>16</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>98</left>
<top>163</top>
<right>458</right>
<bottom>187</bottom>
</rect>
<style>transparent</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Helvetica</font>
<textSize>10</textSize>
<textStyle>bold</textStyle>
<textHeight>13</textHeight>
<name>Currentfile</name>
<script></script>
</part>
<part>
<id>17</id>
<type>field</type>
<visible> <false /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <false /> </lockText>
<rect>
<left>98</left>
<top>45</top>
<right>269</right>
<bottom>376</bottom>
</rect>
<style>scrolling</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name>FontNames</name>
<script></script>
</part>
<part>
<id>26</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>11</left>
<top>103</top>
<right>82</right>
<bottom>160</bottom>
</rect>
<style>shadow</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>26884</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Preview Fonts</name>
<script>on mouseUpset the hilite of me to true --HOUSEKEEPINGput empty into cd fld contextanswer file "Pick a file whose fonts you want to examine:" of type "TEXT"put it into cd fld "currentfile"set the style of cd fld "currentfile" to opaqueif it is not empty thenopen file (cd fld "currentfile")put 0 into startread from file (cd fld "currentfile") at start for 15000put it into cd fld contextfind "%%DocumentFonts:"in cd fld contextset the scroll of cd fld context to (((word 2 of the foundline)-1)*13)play harpsichord dclose file (cd fld "currentfile")end ifput empty into cd fld "currentfile" --HOUSEKEEPINGset the style of cd fld "currentfile" to transparentset the hilite of me to falseend mouseUp</script>
</part>
<part>
<id>33</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>12</left>
<top>44</top>
<right>83</right>
<bottom>101</bottom>
</rect>
<style>shadow</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>22855</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Font List</name>
<script>on mouseUpif the optionkey is down thenif the visible of cd fld "fontnames" is false thenset the visible of cd fld "fontnames" to trueelse set the visible of cd fld "fontnames" to falseexit mouseupend ifset the hilite of me to trueput cd fld fontnames into listget showlist(list,13,"Font:",false,"New,Remove,Cancel")if line 1 of it contains "New" thenask "Add or paste new fontname (you must be precise):"if the result ≠ "Cancel" thenput it & return after cd fld "fontnames"sort cd fld "fontnames"end ifelseif line 1 of it contains "Remove" thenput item 1 of line 2 of it into theFontput item 2 of line 2 of it into theLineanswer "Are you sure you want to remove" && theFont && "from the list?" with "OK" or "Cancel"if it contains "OK" thendelete line (theLine) of cd fld "fontnames"end ifend ifend ifset the hilite of me to false --HOUSEKEEPINGset the visible of cd fld "fontnames" to falseend mouseUp</script>
</part>
<part>
<id>41</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>486</left>
<top>15</top>
<right>525</right>
<bottom>50</bottom>
</rect>
<style>transparent</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>2478</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>New Button</name>
<script>on mouseUpshow cd fld apologiesend mouseUp</script>
</part>
<part>
<id>42</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>7</left>
<top>6</top>
<right>538</right>
<bottom>370</bottom>
</rect>
<style>scrolling</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Helvetica</font>
<textSize>12</textSize>
<textStyle>bold</textStyle>
<textHeight>16</textHeight>
<name>Apologies</name>
<script>on mouseupglobal trueOneset lockscreen to trueset the scroll of cd fld apologies to 0hide cd fld apologiesif trueOne contains true thenput false into trueOnego cd 1end ifend mouseup</script>
<text><span class="style1">AFR 1.1: A font editing utility for Adobe Illustrator 3 Files</span><span class="style3">Click anywhere to hide this field. To print these instructions, type Option-Return.</span><span class="style1"></span><span class="style3">With apologies to the Swiss Army! Well, aren't we all getting tired of seeing Helvetica anyway? I programmed this stack in response to a question raised by John van Pelt of </span><span class="style6">The Christian Science Monitor</span><span class="style3">: is there some way to change all the fonts in an Illustrator document with a search and replace? There sure is. At </span><span class="style6">The New York Times</span><span class="style3"> where I work, our Graphics Wire Service has been doing font replacement for years using a macro in Vantage, the desk accessory word processor. They remove our headline fonts and replace them with different styles of Helvetica to make the graphics printable at client newspapers. Some of their subscribers do the reverse, i.e., substitute their headline font for Helvetica-Bold using the a similar macro. With HyperCard 2, it's feasible to write a stack to do the same thing without using any XFCNs other than ShowList, which is provided by Claris. Likewise. the particularly cunning Search/Replace script used here, though modified, which was also part of the Development Kit. Now if they had only included Balloon Help and disk file management... Illustrator 3 files, saved both normally (without preview), are good old Ascii TEXT. This stack opens TEXT files, and resaves them with new font calls. Bingo. It searches for font names in the context that font names appear in Illustrator, so you can do a graphic that uses the words Helvetica or Times; they won't be changed because they won't occur in the context of a font call. Almost never: there's probably some way to beat this. I programmed it to be verrry picky about context, which makes it run a bit slower but reduces the likelihood of error. At any rate, make a copy of your file before using this utility on it because it is going to save right over the file you specify. Why? Because I'm not getting paid to do this, that's why! Actually, it's to preserve the Illustrator file icon and resource fork without having to resort to XCMDs or XFCNs. Holding down the </span><span class="style4">option key</span><span class="style3"> as the stack opens bypasses the opening animation, which wears thin real fast. Click on each </span><span class="style1">Search For</span><span class="style3"> or </span><span class="style1">Replace</span><span class="style3"> field to change or clear its contents. If you specify a font in a Search field, you must specify a corresponding font in the Replace field next to it or you'll be criticized by the program. To add or remove printer font names from the popup list, click the </span><span class="style1">Font List</span><span class="style3"> button. Holding down the</span><span class="style4"> option key</span><span class="style3"> when doing so shows the font list field itself, into which you could paste a sequence of return-delimited font names manually. Otherwise, you must edit them one at a time. Up to six fonts can be replaced in one pass. Naturally, the printer font name had better be accurate in both columns or A) the fonts won't be replaced if the searched-for font name was wrong, or B) Illustrator will show an error context when it tries to re-open the processed document if the replace font name is wrong. Then you'll wish you had made a copy first! (You could, however, search on the misspelled name and replace it with the correct name to recover the file.) To help you find an accurate font name, the </span><span class="style1">Preview Fonts</span><span class="style3"> button opens the header of an Illustrator file to let you see the actual printer font names in use for that document. You can copy a font name to the clipboard and then paste it into the font list dialogue box to avoid misspellings. Let's see, was that font called "BI Goudy-Bold-Italic" or "BO Goudy-Bold-Oblique" or "Obligue"? Argh. Use cut and paste, it's safer. By the way, if you have asked to Preview Fonts and the first line of the Context window does not scroll immediately to a line beginning with "%%DocumentFonts...", then either you are not looking at an Illustrator file or else there are no fonts being used in that document! Finally, when you're ready to go, hit the </span><span class="style1">Change Fonts</span><span class="style3"> button. A dialog box will ask you what file to "munge" (programmer talk for destroy!); the file you pick will not be saved until the very end of the conversion. You can Cancel at this point, or at any time during the operation, or at the end: ANY mouse click during the execution of the script will interrupt the conversion with no damage to the original. You'll be asked at the end if you want to save the changes. If you hold down the </span><span class="style4">option key</span><span class="style3"> while you click the </span><span class="style1">Change Fonts</span><span class="style3"> button, screen animation will not be suspended, making the conversion much slower. You may want to do this when converting your first few files. I find it reassuring to verify that things are actually happening as expected (you'll be able to see the strings being changed one at a time in the Context Viewer field). Have fun using this. This stack is BetterIdeaWare: if you have a better idea for more stuff along these lines, either do it and send me a copy or ask me and maybe I can program it for the public domain. How about a Color Changer, or a Scitex Color Checker? The Adobe Illustrator 3 file format is the basis for Interchange PostScript, the editable, application-independent PostScript file format being developed by Adobe Systems. There will be many other ways to use it. This stack has been tested mainly on Illustrator 3 format files. </span><span class="style1">Changes from Version 1.0a: </span><span class="style3">This version addresses one complaint, one bug, and several cosmetic and feedback enhancements. A complaint was that the stack was too slow. This has been remedied to some degree by adding a trap to bypass pointless searches. You will notice less cursor "busyness" as a result (for every "hit", the beachball cursor rotates 1/4 turn). I've added progress report messages to let you see Bytes Read, Bytes Written, Elapsed Time and Number of Changes to help "explain" performance (i.e., to remind you that a big file with many fonts being changed takes longer than a small file with few font shifts). For a performance baseline, SAFR 1.1 takes 60 seconds to replace 8 occurences of one font in a 700 kilobyte file (with option key-Change Fonts) on my Mac IIci under System 7, allocating one megabyte of memory to HyperCard. A 64k file with 4 occurences of a font takes 24 seconds. What keeps SAFR from going any faster? HyperCard's limitation of 16 kilobytes per field combined with the lack of a direct search and replace command in HyperTalk, perhaps? Second and more important, memory management: version 1.0a got stupid if the size of the Illustrator file being processed exceeded free space in HyperCard's memory partition. I discovered this when trying to convert a 1.8 megabyte Illustrator file with only two megabytes allocated to HyperCard. Phooey! Plus, it handled this rather sneakily by simply not storing output characters after it reached its mouthfull, thereby truncating the output file (with predictable results). Increasing HyperCard's memory partition helped, but... Rather than try to build memory management into the stack, SAFR now creates a scratch file at the application level (i.e., in the folder where HyperCard resides) to store bytes after they are processed. This file is named "SwissArmyScratchFile" and is emptied after the output file is written or after a user-commanded interrupt. A lot of applications use temporary files on disk; this is a known and reliable technique. Since HyperCard 2 does not support Finder-type file management, the scratch file can't be erased by the stack. But if you want to trash it manually, that's OK; a new scratch file will be created when needed. This means that the size of a file to be converted is limited only by disk space available rather than by memory; you'll need as much free space on disk as the size of the file you want to convert. That is cool and predictable. Cosmetic changes in version 1.1 include font animation on startup, progress reporting, fixed button hiliting sequences, and hides and shows on card 2, and the addition of a finder icon for System 7 users. Have fun.Gary CosiminiPresslink address: COSIMINI, GEnie: GCOSIMINI, America OnLine: COSIMINI. Voice 212-556-7298. This is release 1.1 of the Swiss Army Font Remover, 12/16/91.</span></text>
</content>
<content>
<layer>card</layer>
<id>3</id>
<text>Helvetica-Oblique</text>
</content>
<content>
<layer>card</layer>
<id>4</id>
<text>Helvetica-Bold</text>
</content>
<content>
<layer>card</layer>
<id>5</id>
<text>Helvetica-BoldOblique</text>
</content>
<content>
<layer>card</layer>
<id>9</id>
<text>Times-Italic</text>
</content>
<content>
<layer>card</layer>
<id>10</id>
<text>AGaramond-Semibold</text>
</content>
<content>
<layer>card</layer>
<id>11</id>
<text>Times-BoldItalic</text>
</content>
<content>
<layer>card</layer>
<id>2</id>
<text>Helvetica</text>
</content>
<name></name>
<script>on returnKeyif the optionkey is down thenput "Printing SAFR Instructions..." into msgprint cd fld "Apologies"put empty into msghide msgpass returnKeyend ifend returnKeyon opencard --HOUSEKEEPINGsort cd fld fontnamesdo cleanUpend opencardon closecard --HOUSEKEEPINGdo cleanUpend closecardon getFont --CALLED WHEN USER CLICKS ON FONT FIELDSglobal theFontput cd fld fontnames into listget showlist(list,13,"Font:",false,"OK,Clear,Cancel")if line 1 of it contains "Cancel" thenexit getFontelseif line 1 of it contains "Clear" thenput empty into theFontelseif line 1 of it contains "OK" thenput item 1 of line 2 of it into theFontend ifend ifend ifend getFonton cleanUp --HOUSEKEEPING FOR THIS CARDhide msgput "" into cd fld "context"put "" into cd fld "currentfile"set the style of cd fld "currentfile" to transparentset the hilite of cd btn "Change Fonts" to falseend cleanUp</script>
</card>
card_3015.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<script>function scrollData-- this function stores the scroll display data specified by the-- user. DO NOT CHANGE OR MOVE THIS FUNCTION!return "The Swiss Army Font Remover!" & return ¬& " From Switzerland, the country that brought you cheese with holes, banking gnomes, fondue pots and the most overused typeface in the world..." & return & "true"end scrollDataon mouseUpif the optionKey is down then updateDataelseset hilite of me to line 3 of scrollData()put line 1 of scrollData() into idleTxtput line 2 of scrollData() into mainTxtset the textSize of me to (height of me div 3) * 2put the width of me div (the textHeight of me div 3) into maxLettersadd maxLetters mod 2 to maxLetters -- make it evenget (maxLetters - length(idleTxt)) div 2if it > 0 then put char 1 to it of spaces() into halfSpaceselse put empty into halfSpacesput char 1 to (maxLetters - 5) of spaces() into fullSpaces-- put halfSpaces & idleTxt & fullSpaces & mainTxt & fullSpaces & idleTxt & halfSpaces into scrollTextput halfSpaces & mainTxt & fullSpaces & idleTxt & halfSpaces into scrollText-- if (item 1 of the clickloc) > (item 1 of loc of me)--then scrollRight scrollText,maxLetters-- else scrollLeft scrollText,maxLettersscrollLeft scrollText,maxLettersend ifclick at the loc of cd btn id 2end mouseUpon scrollLeft scrollText,maxLettersput (length(scrollText) - maxLetters) into scrollSizerepeat with i = 1 to scrollSizewait 2set name of me to char i to (i + maxLetters) of scrollTextend repeatend scrollLeft-- on scrollRight scrollText,maxLetters-- put (length(scrollText) - maxLetters) into scrollSize-- repeat with i = scrollSize down to 1-- set name of me to char i to (i + maxLetters) of scrollText-- end repeat-- end scrollRightfunction spacesreturn " "end spaceson updateData-- write date info back to the data function handler in this scriptask "What message should the button display at rest?" with line 1 of scrollData() -- ∆if it is empty then exit to hyperCardput it into idleMsgask "What traveling text should the button display?" with line 2 of scrollData() -- ∆if it is empty then exit to hyperCardput it into mainMsganswer "Should the text be:" with "White" or "Black"if it is "White" then put true into myHiliteelse put false into myHiliteset hilite of me to myHiliteget script of meput quote & idleMsg & quote && "& return &" && quote & mainMsg & quote && "& return &" && quote & myHilite & quote into newDataput newData into char offset(quote,it) to (offSet("end ",it) - 2) of itset script of me to itset textAlign of me to centerset name of me to idleMsgend updateData</script>
</part>
<part>
<id>9</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>29</left>
<top>46</top>
<right>65</right>
<bottom>83</bottom>
</rect>
<style>transparent</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>1011</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script>on mouseUpanswer "Quit to Home or Finder:" with "Cancel" or "Home" or "Finder"if it contains "Home" then domenu "Home"else if it contains "Cancel" then exit mouseUpelsedomenu "Quit Hypercard"end ifend mouseUp</script>
</part>
<part>
<id>2</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>30</left>
<top>330</top>
<right>65</right>
<bottom>365</bottom>
</rect>
<style>transparent</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>27009</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script>on mousedownhide cd pictureplay "whoosh"show cd pictureset the textfont of cd btn id 1 to timeshide cd pictureset the textstyle of cd btn id 1 to italicplay "whoosh"show cd picturevisual effect dissolvego next cardend mousedown</script>
</part>
<part>
<id>3</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>28</left>
<top>11</top>
<right>67</right>
<bottom>46</bottom>
</rect>
<style>transparent</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>2478</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>New Button</name>
<script>on mouseUpglobal trueOneput true into trueOneset lockscreen to truego cd 2show cd fld apologiesend mouseUp</script>
</part>
<name></name>
<script>on opencardset the textstyle of cd btn id 1 to plainset the textstyle of cd btn id 1 to boldset the textfont of cd btn Id 1 to helveticaend opencard</script>